x86/ioreq_server: make p2m_finish_type_change actually work
Commit
6d774a951696 ("x86/ioreq server: synchronously reset outstanding
p2m_ioreq_server entries when an ioreq server unmaps") introduced
p2m_finish_type_change(), which was meant to synchronously finish a
previously initiated type change over a gpfn range. It did this by
calling get_entry(), checking if it was the appropriate type, and then
calling set_entry().
Unfortunately, a previous commit (
1679e0df3df6 "x86/ioreq server:
asynchronously reset outstanding p2m_ioreq_server entries") modified
get_entry() to always return the new type after the type change, meaning
that p2m_finish_type_change() never changed any entries. Which means
when an ioreq server was detached and then re-attached (as happens in
XenGT on reboot) the re-attach failed.
Fix this by using the existing p2m-specific recalculation logic instead
of doing a read-check-write loop.
Fix: 'commit
6d774a951696 ("x86/ioreq server: synchronously reset
outstanding p2m_ioreq_server entries when an ioreq server unmaps")'
Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
Signed-off-by: Yu Zhang <yu.c.zhang@linux.intel.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Release-acked-by: Julien Grall <julien.grall@arm.com>